/*
 * @Author: wangtao
 * @Date: 2020-06-29 16:32:41
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-04-15 14:57:49
 * @Description: file content
 */

import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  Text,
  PixelRatio,
  TouchableOpacity,
  ScrollView,
} from 'react-native';
import {
  mainBgColorWhite,
  screenWidth,
  px2dp,
  fontColorDeepGray,
  fontColorBlack,
  mainBgColorLightGray,
  splitLineColorLightGray,
  fontColorSecDeepGray,
  fontColorLightGray,
} from '@/styles';
import { FormSelect, FormInput, Button } from '@/common';
import { idCardBack, idCardFront } from '@/images';
import CameraCard from '../../components/camera-card';
import Upload from '../../components/upload';

const { Submit } = Button;

export default class CertWrap extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  render() {
    const { policyUrls, onChange } = this.props;
    return (
      <>
        <View style={styles.wrap}>
          <View style={styles.drivingWrap}>
            <Text style={styles.drivingTitle}>
              上传电子保单
              <Text style={{ color: fontColorSecDeepGray }}>(最多上传5张)</Text>
            </Text>
            <View style={styles.drivingLicense}>
              <Upload
                limit={5}
                action='upload?dirName=insurance'
                fileList={policyUrls}
                onChange={(fileList) => {
                  // console.log('🚀🚀🚀wimi======>>>fileList',fileList)
                  onChange('policyUrls', fileList);
                }}
              />
            </View>
          </View>
        </View>
      </>
    );
  }
}
const styles = StyleSheet.create({
  wrap: {
    width: screenWidth,
    backgroundColor: mainBgColorWhite,
    paddingHorizontal: px2dp(32),
    paddingVertical: px2dp(40),
    marginTop: px2dp(24),
  },
  drivingLicense: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    flexWrap: 'wrap'
  },
  drivingTitle: {
    fontSize: px2dp(28),
    color: fontColorBlack,
    marginBottom: px2dp(40),
  },
});
